import * as types from './mutation-types'

const mutations = {
 [types.SET_SINGER](state, singer) {//歌手数据
    state.singer = singer
  },
  [types.SET_PLAYING_STATE](state, flag) {//播放状态
    state.playing = flag
		console.log("state.playing",state.playing)
  },
  [types.SET_FULL_SCREEN](state, flag) {//播放器张开还是收起
    state.fullScreen = flag
  },
  [types.SET_PLAYLIST](state, list) {//播发列表
    state.playlist = list
  },
  //[types.SET_SEQUENCE_LIST](state, {list,index}) {//顺序列表
  [types.SET_SEQUENCE_LIST](state, mun) {//顺序列表
		state.currentSong=mun.data[mun.index] //一条数据
		state.sequenceList = mun.mun //顺序列表数据
  },
	
	[types.SET_SEQUENCE_CLEAR](state, mun) {//顺序列表 清空数据
		state.currentSong=[] //一条数据
		state.sequenceList =[] //顺序列表数据
	},
	
	//歌曲结束在切换歌曲
  [types.QieHuan](state, index) {//顺序列表
	console.log("types.QieHuan",state.playlist[index])
	state.currentSong=state.playlist[index]
  },
  [types.SET_PLAY_MODE](state, mode) { //播放模式
    state.mode = mode
  },
  [types.SET_CURRENT_INDEX](state, index) {//当前播放的索引
    state.currentIndex = index
  },
  [types.SET_DISC](state, disc) {//歌单界面
    state.disc = disc
  },
  [types.SET_TOP_LIST](state, topList) {//排行榜数据
    state.topList = topList
  },
  [types.SET_SEARCH_HISTORY](state, history) {//搜索历史
    state.searchHistory = history
  },
  [types.SET_PLAY_HISTORY](state, history) { //add-song播放历史
    state.playHistory = history
  },
  [types.SET_FAVORITE_LIST](state, list) {//用户喜欢的数据
    state.favoriteList = list
  },
  [types.GQUB](state, list) { //新歌曲数据
  // state.gedata = list
    state.currentSong = list
	console.log('state.gedata',state.gedata)
  },
  [types.isbtn](state, data) { //istrue
	state.istrue = data
  },
  [types.issosbtn](state, data) { //搜索框点击的数据
	state.sosid = data
  },
  [types.plength](state, data) { //搜索框点击的数据
	state.plength = data
 },
 [types.pcoc](state, data) { //模拟点击页面
	state.dianji = data++
 }
}
export default mutations